#include <stdio.h>
#include <vector>
#include <iostream>
using namespace std;


vector<int> multiply(const vector<int>& A)
{
    int length = A.size();
    vector<int> B;
    int i = 0, j = 0;
    for (i = 0; i < length; i++)
    {
        int sum = 1;
        for (j = 0; j < length; ++j)
        {
            if (i == j)
            {
                continue;

            }
            else
            {
                sum = sum*A[j];

            }

        }
        B.push_back(sum);

    }
    return B;

}


void test()
{
    vector<int> A ;
    A.push_back(1);
    A.push_back(2);
    A.push_back(3);
    A.push_back(4);
    A.push_back(5);
    vector<int> ret=multiply(A);
    int i = 0;
    for (i = 0; i < ret.size(); ++i)
    {
        cout << ret[i] << " ";

    }
    cout << endl;

}

int main()
{
    test();
    return 0;

}

